export enum TodoDataSetActionTyep {
  ADD_TODO ='ADD_TODO ',
  TOGGLE_TODO = 'TOGGLE_TODO'
} 

interface AddTodoActionType {
  type:string,
  payload:{text:string}
}
interface ToggleTodoActionType {
  type:string,
  payload:{id:string | number}
}
export type  TodoActionsTypeAll= AddTodoActionType | TodoDataSetActionTyep

export const addTodo = (text:string):AddTodoActionType=>({
  type:TodoDataSetActionTyep.ADD_TODO,
  payload:{text}
})

export const toggleTodo=(id:string | number):ToggleTodoActionType=>({
  type:TodoDataSetActionTyep.TOGGLE_TODO,
  payload:{id}
})